<%@page import="java.util.Calendar"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@page import="com.srini.pojos.LoggedInUser"%>
<%@page import="com.srini.util.AppUtil"%><html lang="en">
<head>
<title>D M S - Deputation Management System</title>

<link rel="stylesheet" href="css/jqtransform.css" type="text/css"
	media="all" />
<link rel="stylesheet" href="css/jquery-ui-1.8.16.custom.css" />
<link rel='stylesheet' type='text/css' href='css/fullcalendar.css' />
<link rel='stylesheet' type='text/css' href='css/fullcalendar.print.css'
	media='print' />
<link rel="stylesheet" href="css/ui.jqgrid.css" type="text/css"
	media="all" />
<link rel="stylesheet" href="css/global.css" type="text/css" media="all" />
<link rel="stylesheet" href="header/header.css" type="text/css" media="all" />
<link rel="icon" href="images/Timesheet-icon.png" type="image/x-icon" />  
<link rel="shortcut icon" href="images/Timesheet-icon.png" type="image/x-icon" />

<script type='text/javascript' src='js/jquery.js'></script>
<script type='text/javascript' src='js/grid.locale-en.js'></script>
<script type='text/javascript' src='js/jquery.jqGrid.min.js'></script>
<script type="text/javascript" src="js/jquery.jqtransform.js"></script>
<script type='text/javascript' src='js/jquery-ui-1.8.16.custom.min.js'></script>
<script type='text/javascript' src='js/jquery-ui-timepicker-addon.js'></script>
<script type='text/javascript' src='js/fullcalendar.min.js'></script>
<script type="text/javascript" src="app-script/onReady.js"></script>
<script type="text/javascript" src="app-script/notifier.js"></script>
<script type='text/javascript' src='app-script/FCController.js'></script>
<script type="text/javascript" src="app-script/events.js"></script>

<script language="javascript">
        
$(document).ready(function() {
        <% String message = (String)request.getAttribute("message");
    	if (message != null) {
    	%>
    	notifierInst.showMessage("<%=message%>");
    	<%}
    	String currentPage = (String) request.getAttribute("currentPage");
    	if (AppUtil.isEmpty(currentPage)) {
    		currentPage= "home";
    	}
       %>
       
		$(".formDiv").hide().css("visibility","visible");
		$(".rightNav").removeClass("loading");
		$('.<%= currentPage %>').show();
		$('.leftNav li a[rel=<%= currentPage%>]').addClass('active');
	});

</script>
<%
LoggedInUser user = (LoggedInUser) session.getAttribute("loggedInUser");
String userName = user.getUserInfo().getDisplayName();
String role = user.getRole().getRole();
if (AppUtil.isEmpty(userName))
	userName = user.getUserInfo().getFirstName();
if (AppUtil.isEmpty(userName)) {
	userName = user.getUserName();
}
	
%>
</head>
<body>
<jsp:include page="header/header-bar.jsp" ></jsp:include>
	<div id="wrapper">
		<div class="container">
			<div class="content">
				<div class="header"><div class="notifier ui-helper-clearfix" id="notifier"></div></div>
				<div class="navWrapper">
					<div class="leftNav">
						<ul>
							<li><a href="#" rel="home">Home</a></li>
							<li><a href="#" rel="timesheet">Time Sheet</a></li>
							<li><a href="#" rel="reimbursement">Reimbursement</a></li>
							<li><a href="#" rel="medical">Medical Exempt</a></li>
							<li><a href="#" rel="leaveapp">Leave Calendar</a></li>
							<li><a href="#" rel="userprofile">User Profile</a></li>
							<li><a href="#" rel="listofholidays">Holiday's List</a></li>
							<li><a href="#" rel="manageract">Manager Activities</a></li>
							<% if (role != null && role.equals("Admin")) { %>
							<li><a href="#" rel="admin">Admin Activities</a></li>
							<li><a href="#" rel="database">Database Activities</a></li>
							<%} %>
						</ul>
					</div>
					<div class="rightNav loading">
						<div class="home formDiv showDiv" style="visibility: hidden">
							<h2 class="heading">Welcome</h2>
							<br></br><span style="font-size: 12px; text-align: justify;">Welcome to <b>Deputation Management System</b>&nbsp;! <br></br> 
									Staff augmentation is a regular practice when it comes to IT
									service industry. Employees of one organization need to work
									within the premises of another organization - typically the
									Client- either physically or virtually. Management of such
									distantly deputed employees poses multiple challenges in
									areas such as- <br></br>
<ul class="bullets">
<li>Safeguarding company confidential information of both the parent company and the clients</li>
<li>HR undertakings like talent management, project allocation etc</li>
<li>Operational processes like Leave planning, tracking and Attendance management</li>
<li>Delivery excellent related processes like performance tracking and improvement</li>
<li>Financial exchanges like claims and reimbursements as well as salary processing</li>
<li>Reporting hierarchy maintenance</li> 
<li>Internal and client Process adherence</li>
</ul>
								 <br />
								 In today's paperless world, for conforming to
										parent company processes while working within client premises
										the access to the parent company applications from the client
										environment is inevitable. Internet being the all pervasive
										platform, can be used for this purpose however the biggest
										challenge in this endeavor is to ensure that the Chinese wall
										between these two companies is not breached and that there is
										no illegitimate leakage of data. <br></br>In layman's terms; <i>We need an
										office away from office</i>. And that's what <b>DMS</b> truly offers! </span>
										<br></br>
										<div align="right"><a href="#" style="readMoreLink">Read More...</a></div>
						</div>
						<div class="timesheet formDiv" style="visibility: hidden">
							<form id="timesheet" name="timesheet" class="jqTransform"
								method="post" action="tttimeSheet">
								<h2 class="heading">Time Sheet</h2>
								
								<div class="sectionHeader" id="generic">
									Generic Timings<div class="sectionHeaderClose">X</div>
								</div>
								<div id="generic1" class="sectionBox">
								Please select dates, IN and OUT timings to generate time sheet.<br /><br />
								<div class="section">
								<div class="rowElem">
									<label for="period">For Period:</label> <input type="text"
										id="from" name="from" style="margin-right: 10px;" /> <span
										class="icon-wrp ui-state-default" for="from"><span
										class="ui-icon ui-icon-calendar"></span>
									</span> <label for="to" class="next-control">to</label> <input
										type="text" id="to" name="to" /> <span
										class="icon-wrp ui-state-default" for="to"><span
										class="ui-icon ui-icon-calendar"></span>
									</span>
								</div>
								<div class="rowElem" style="padding-top: 20px">
									<label for="period">Work Hrs:</label> <input type="text"
										id="fromHrs" name="fromHrs" style="margin-right: 10px;" /> <span
										class="icon-wrp ui-state-default" for="fromHrs"><span
										class="ui-icon ui-icon-clock"></span>
									</span> <label for="toHrs" class="next-control">to</label> <input
										type="text" id="toHrs" name="toHrs" /> <span
										class="icon-wrp ui-state-default" for="toHrs"><span
										class="ui-icon ui-icon-clock"></span>
									</span>
								</div>
								</div>
								<div class="rowElem btnRow">
									<input type="button" value="Generate" id="timeSheetBtn"/> <input type="reset"
										value="Reset" />
								</div>
								<div class="clear"></div>
								</div><br/>
								<div id="shift" class="sectionHeader">
									Variable Timings/Shift Timings
									<div class="sectionHeaderClose">X</div>
								</div>
								<div id="shift1" class="sectionBox">
									If your timings are vary.. enter ur timings here
									<table border="0" cellpadding="0" cellspacing="0">
									<tr>
									<td>Mon</td><td>Tue</td><td>Wed</td><td>Thu</td><td>Fri</td>
									</tr>
									</table>
								</div>		
							</form>
						</div>
						<div class="reimbursement formDiv" style="visibility: hidden">
							<form id="reimburse" name="reimburse" class="jqTransform"
								method="post" action="ttreimburse">
								<h2 class="heading">Reimbursement Form</h2>
								Please select month and form type to generate Reimbursement details.<br /><br />
								NOTE: <strong>Please fill in User details before generating File.</strong><br/><br /><br />
								<div class="section">
									<div class="rowElem">
										<label>Auto Generate?</label>
										<input type="checkbox" id="autoGenChkBox"/>
									</div>
									<div class="rowElem">
										<label for="month">For Month:</label> <select id="month"
											name="month">
											<option value="0">Select Month</option>
											<option value="1">January</option>
											<option value="2">February</option>
											<option value="3">March</option>
											<option value="4">April</option>
											<option value="5">May</option>
											<option value="6">June</option>
											<option value="7">July</option>
											<option value="8">August</option>
											<option value="9">September</option>
											<option value="10">October</option>
											<option value="11">November</option>
											<option value="12">December</option>
										</select>
									</div>
									<div class="rowElem">
										<label for="formtype">Form Type:</label> <select id="formtype"
											name="formtype">
											<option value="0">Select Form</option>
											<option value="1">Reimbursemet Form</option>
											<option value="2">Cash &amp; Travel Voucher</option>
										</select>
									</div>
								</div>
								<div class="rowElem btnRow">
									<input type="button" value="Generate" id="reimburseBtn" />
									<input type="button" value="Show Sumamry" id="showSumry" />
								</div>
								<div class="clear"></div>
							</form>
						</div>
						<div id="sumryTbl" class="myTable sumryTbl formDiv" style="margin-top: 40px;visibility: hidden">
								<table width="100%" cellpadding="0" cellspacing="0">
									<tr><th width="10%"><input type="checkbox" name="checkThisAll" id="checkThisAll"/></th><th width="20%">Month</th><th width="20%">Travel Allowance</th><th width="20%">Food Allowance</th><th width="20%">Total Amount</th><th width="10%">Report</th></tr>
									<tbody id="sumryTblbody"></tbody>
								</table>
						</div>
						<div class="medical formDiv" style="visibility: hidden">
							<h2 class="heading">Medical Receipt</h2>
									<form action="ttaddMedical" class="jqTransform" method="post"
											name="addMedical">
											<div class="section">
											<div class="rowElem">
												<label for="billNo">Bill No.</label> <input type="text"
													id="billNo" name="billNo" value="" size="16" /> <label for="billDate"
													class="next-control">Bill Date</label> <input type="text"
													id="billDate" name="billDate" value="" size="13"/> <span
										class="icon-wrp ui-state-default" for="billDate"><span
										class="ui-icon ui-icon-calendar"></span></span>
											</div>
											<div class="rowElem">
												<label for="drName">Doctor Name</label> <input
													id="drName" name="drName" type="text" value="" size="16" /> <label
													for="amount" class="next-control">Amount
													</label> <input type="text" id="amount" name="amount" value=""
													size="16" />
											</div>
											<div class="rowElem">
												
												<label for="patName">Patient Name:</label>
												<input type="text" id="patName" name="patName" size="16" />
												<label for="relation" class="next-control">Relation:</label> <select id="relation"
													name="relation">
													<option value="self">Self</option>
													<option value="father">Father</option>
													<option value="mother">Mother</option>
													<option value="wife">Wife</option>
													<option value="kid">Kid</option>
												</select>
											</div>
											</div>
											<div class="rowElem btnRow">
												<input type="button" id="addBill" value="Add Bill" />
												<input type="button" id="exportBills" value="Export Bills"/>
											</div>
										</form>
									</div>
						<div class="leaveapp formDiv" style="visibility: hidden">
							<form id="leave" name="leave" class="jqTransform" method="post"
								action="ttaddHoliday">
								<h2 class="heading">Leave Calendar</h2>
								Please select dates on which you want to apply leave and click
								SAVE. <br />
								<br />
								<div class="section" style="width: 100%;">
									<div id='calendar'></div>
								</div>
								<div class="rowElem">
									<a href="javascript: void(0);" id="saveCalendar"> Save</a> <input
										type="hidden" name="type" value="0" /> <input type="hidden"
										name="leaves" value="" />
								</div>
								<div class="clear"></div>
							</form>
						</div>
						<div class="userprofile formDiv" style="visibility: hidden">
							<form id="user" name="user" class="jqTransform" method="post"
								action="ttuserprofile">
								<h2 class="heading">User Profile</h2>
								<div class="rowElem">
									<label for="empId">Employee Id:</label> <input type="text"
										name="empId" value="<%=user.getUserInfo().getEmpId() %>" />
									<label for="empName" class="next-control">Employee Name</label>
									<input type="text" name="empName"
										value="<%=user.getUserName() %>" readonly="readonly" />
								</div>
								<div class="rowElem">
									<label for="firstname">First name</label> <input
										name="firstname" type="text"
										value="<%= user.getUserInfo().getFirstName() %>" /> <label
										for="lastname" class="next-control">Last name</label> <input
										name="lastname" type="text"
										value="<%= user.getUserInfo().getLastName() %>" />
								</div>
								<div class="rowElem">
									<label for="manager">Manager Name:</label> <input type="text"
										name="manager" value="<%=user.getUserInfo().getManager() %>" />
									<label for="project" class="next-control">Project</label> <input
										type="text" name="project"
										value="<%=user.getUserInfo().getProject() %>" />
								</div>
								<div class="rowElem">
									<label for="distance">Distance (To &amp; Fro)</label> <input
										name="distance" type="text"
										value="<%=user.getUserInfo().getDistanceFromHome() %>" />
									<label for="workplace" class="next-control">Work Place</label> <input
										type="text" name="workplace"
										value="<%=user.getUserInfo().getWorkPlace() %>" />
								</div>
								<div class="rowElem">
									<label for="vehType">Vehicle Type:</label> <input type="radio"
										value="0" name="vehicle_type" id="vehicle_type"
										<%if ("0".equals(user.getUserInfo().getVehicle())) { %>
										checked="checked" <%} %> /> <label for="vehicle_type"
										class="forradio">2-Wheeler</label> <input type="radio"
										value="1" name="vehicle_type" id="veh_type"
										<%if ("1".equals(user.getUserInfo().getVehicle())) { %>
										checked="checked" <%} %> /> <label for="veh_type"
										class="forradio">4-Wheeler</label>
										<input type="radio"
										value="2" name="vehicle_type" id="veh_type1"
										<%if ("2".equals(user.getUserInfo().getVehicle())) { %>
										checked="checked" <%} %> /> <label for="veh_type"
										class="forradio" style="width: 130px;">Company Transport</label>
								</div>
								<div class="rowElem">
									<label for="foodperday">Address</label>
									<textarea id="address" style="width: 485px;" name="address" rows="2" ><%= user.getUserInfo().getAddress() %></textarea>
								</div>
								<div class="rowElem btnRow">
									<input type="submit" value="Save" />
								</div>
								<div class="clear"></div>
							</form>
						</div>
						<div class="listofholidays formDiv" style="visibility: hidden">
							<form id="holidaylist" name="holidaylist" class="jqTransform">
								<h2 class="heading">List Of Holidays</h2>
								List of Holiday's for the Year <%= Calendar.getInstance().get(Calendar.YEAR) %><br/><br/>
								<div class="rowElem">
									<table id="list3"></table>
									<div id="pager3"></div>
								</div>
								<div class="clear"></div>
							</form>
						</div>
						<div class="manageract formDiv" style="visibility: hidden">
						
							<h2 class="heading">Managerial Activities</h2>
							
							<div class="clear"></div><br>
							<form id="manact" name="manact" action="ttgroupExec" method="post">
							<p class="subheading">Reportees:</p>
							<div class="myTable">
								<table id="myTable" width="100%" cellpadding="0" cellspacing="0">
									<tr id="headerRow"><th><input type="checkbox" name="checkAll" id="checkAll"/></th><th>Full Name</th><th>Month</th><th colspan="6" align="center">Report Type</th></tr>
									<tbody id="tbody"></tbody>
								</table>
							</div>
							<br></br>
							<div class="jqTransform"><input type="button" id="groupExec" value="Generate Report"/>
							<!-- <input type="button" id="genSummary" value="Generate Summary"/>--></div>				
						</form>						
						</div>
						<div class="admin formDiv" style="visibility: hidden">
							<h2 class="heading">Admin Activities</h2>
							<div id="tabs">
								<ul>
									<li><a href="#tabs-1">Add User</a></li>
									<li><a href="#tabs-2" rel="holiday">Add Holiday</a></li>
									<li><a href="#tabs-3" rel="userList">Users List</a></li>
								</ul>
								<div id="tabs-1">
									<div class="section">
										<form action="ttaddUser" class="jqTransform" method="post"
											name="addUser">
											<span class="subheading">Employee Data</span>
											<div class="rowElem">
												<label for="empName">User Name</label> <input type="text"
													name="empName" id="empName" value="" size="16" /> <label for="email"
													class="next-control">Email</label> <input type="text"
													name="email" id="email" value="" size="16" />

											</div>
											<div class="rowElem">
												<label for="trallowance">Travel Expense</label> <input
													id="trallowance" name="trallowance" type="text" value="" size="16" /> <label
													for="foodallowance" class="next-control">Food
													Expense:</label> <input type="text" name="foodallowance" id="foodallowance" value=""
													size="16" />
											</div>
											<div class="rowElem">
												<label for="role">Role:</label> <select id="role"
													name="role">
													<option value="User">User</option>
													<option value="Admin">Admin</option>
												</select>
												<label for="manager" class="next-control" style="margin-left: 86px">Manager:</label>
												<input type="text" id="manager" size="16" />
												<input type="hidden" id="managerId" name="managerId"/>
											</div>
											<div class="rowElem btnRow">
												<input type="button" id="addUserBtn" value="Create User" />
											</div>
										</form>
									</div>
									<div class="clear"></div>
								</div>

								<div id="tabs-2">
									<div class="section">
										<form action="ttaddHoliday" class="jqTransform" method="post"
											name="addHoliday">
											<span class="subheading">Holiday</span>
											<div class="rowElem">
												<label for="holiday">Holiday Date</label> <input
													type="hidden" name="type" value="1" /> <input type="text"
													name="holiday" id="holiday" value="" size="13"/>  <span
										class="icon-wrp ui-state-default" for="holiday"><span
										class="ui-icon ui-icon-calendar"></span>
												</span>
											</div>
											<div class="rowElem">
												<label for="desc">Description</label> 
													<input type="text" name="desc" id="desc" value="" size="16"/> 
											</div>
											<div class="rowElem btnRow">
												<input type="button" id="addHoliday" value="Add" />
											</div>
										</form>
									</div>
									<div class="clear"></div>
								</div>
								<div id="tabs-3">
									<div class="section">
										<form class="jqTransform" method="post"
											name="usersList">
											<span class="subheading">List of Users</span>
											<div class="rowElem" style="width: 710px;">
									<table id="users"></table>
									<div id="pagers"></div>
								</div>
										</form>
									</div>
									<div class="clear"></div>
								</div>
							</div>
						</div>
						<div class="database formDiv" style="visibility: hidden">
							<form id="database" name="database" 
								method="post" action="dbUI">
								<h2 class="heading">Database UI</h2>
								User can edit database details from the application<br />
								
								<div class="section">
								<table width="100%" cellpadding="0" border="0" class="simpletblBrdr"><tr><td>
										<select id="userList" name="userList">
											<option value="0">Select User</option>
										</select>
									</td><td>
										<select id="tableList" name="tableList">
											<option value="0">Select Table</option>											
										</select>
										</td>
										<td>
										<select id="dbcolumn" name="dbcolumn">
											<option value="0">Select Column</option>
										</select>
										</td><td>
										<select id="oper" name="oper">
											<option value="0">Operator</option>
											<option value="1">Equals</option>
											<option value="2">Not Equals</option>
											<option value="3">Less than</option>
											<option value="4">Greater then</option>											
										</select>
										</td>
										<td>
										<input type="text" name="dbvalue" size="4" id="dbvalue"/>
										</td>
										<td><input type="button" name="dbquery" id="dbquery" value="GO"></input></td>
										</tr></table>
										<table width="100%" class="simpletblBrdr">
										<tbody id="userEntries"></tbody></table>
								</div>
								
								<div class="clear"></div>
							</form>
						</div>
					</div>
				</div>
			</div>
			
		</div>
		<div id="footer" style="background: #1f1f1f;"></div>
	</div>
	</body>
	
</html>
